<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	
<?php
    $id = $_GET["id"];
    //造连接对象
    $db = new MySQLi("localhost","root","root","pro");
    //写SQL语句
    $sinfo = "select * from product where id={$id}";    

    $rinfo = $db->query($sinfo);

//var_dump($rinfo);
    
    $ainfo = $rinfo->fetch_row();
?>

<form action="a1.php" method="POST">
    <div>ID<input type="text" name="id" value="<?php echo $ainfo[0]; ?>" /></div>
    <div>名称<input type="text" name="name" value="<?php echo $ainfo[1]; ?>" /></div>
    
    
    
    <div>标题<input type="text" name="title" value="<?php echo $ainfo[2]; ?>" /></div>
    
    
    
    <div>类型<input type="text" name="type" value="<?php echo $ainfo[3]; ?>" /></div>


    <div>价格<input type="text" name="price" value="<?php echo $ainfo[4]; ?>" /></div>


    
    <div><input type="submit" value="修改" /></div>
</form>


</body>
</html>













